package mysql

import "gorm.io/gorm"

type Doctor struct {
	gorm.Model
	DoctorCode string `gorm:"type:varchar(30);not null;comment:医生工号"`
	Password   string `gorm:"type:varchar(32);not null;comment:密码"`
	Node       string `gorm:"type:varchar(30);not null;comment:权限"`
}

func (d *Doctor) DoctorFindDoctorCode(db *gorm.DB, code string) error {
	return db.Debug().Where("doctor_code=?", code).First(d).Error
}

func (d *Doctor) DoctorShow(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).Find(d).Error
}
